﻿<html>
  <head>
    <title>中国海洋大学零星采购管理系统</title>
    <%= stylesheet_link_tag "/javascripts/ext/resources/css/ext-all.css" %>
    <%= stylesheet_link_tag "/stylesheets/images.css" %>
    <%= stylesheet_link_tag "/javascripts/ext/examples/ux/css/ColumnNodeUI.css" %>
    <%= stylesheet_link_tag "/stylesheets/fileuploadfield.css" %>


    <%= javascript_include_tag "ext/adapter/ext/ext-base.js" %>
    <%= javascript_include_tag "ext/ext-all.js" %>
    <%= javascript_include_tag "ext/src/locale/ext-lang-zh_CN.js" %>
    <%= javascript_include_tag "/javascripts/FileUploadField.js" %>
    <%= javascript_include_tag "/javascripts/application.js" %>
    <%= javascript_include_tag "/javascripts/aboutImage.js" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <style type="text/css">
      td {
        font-size: 12px;
        text-decoration: none;
      }

      a {
        font-size: 12px;
        color: #FFF;
      }

      #qdcs {
        font-size: 12px;
        color: #FFF;
        text-decoration: none;
      }
      .f12 {
        color: #FFF;
        font-size: 12px;
      }
      .b12 {
        font-size: 12px;
        color: #000;
        font-weight: 100;
      }
    </style>
    <script type="text/javascript">
      function shoucang()
      {

        AddFavorite(window.location,document.title)
      }
      function shouye()
      {

        SetHome(this,window.location)
      }

      var registerWin;
      Ext.onReady(function(){

        Ext.QuickTips.init();



        var loginButton = new Ext.Button({
          text: '    登  录    ',
          handler: function(){
            loginButton.setDisabled(true);
            if (loginForm.form.isValid()) {
              loginForm.form.submit({
                success: function(result, resp){
                  if (resp.result.info.indexOf("success") >= 0) {
                    var test = resp;
                    window.document.location.href = '/';
                    //window.location = '/'
                  } else {
                    Ext.MessageBox.alert('消息', resp.result.info);
                    loginButton.enable();
                  }
                },
                failure: function(result, request){
                  loginButton.enable();
                  Ext.MessageBox.alert('消息', '登录过程中和服务器的通信失败!');
                }
              });
            }
            else {
              loginButton.enable();
              Ext.MessageBox.alert('输入验证有错', '请输入必输选项');
            }
          }
        });

        var registerButton = new Ext.Button({
          text:'供应商注册',
          handler:function(){
            registerWin = new Ext.Window({
              title:'供应商注册',
              width:629,
              height:400,
              modal: true, // 动态的，就是背景是否屏蔽
              autoScroll:true,
              autoLoad:{
                url:'/vendor/register',
                scripts: true
              }

            });
            registerWin.resizable = false;
            registerWin.show();
          }
        })


        // simple array store
        var userTypeStore = new Ext.data.ArrayStore({
          //fields: ['value', 'text'],
          fields: ['text'],
          data : userTypeDataArray
        });

        var userType = new Ext.form.ComboBox({
          fieldLabel: '用户类型',
          store: userTypeStore,
          valueField:'text',
          displayField:'text',
          typeAhead: true,
          mode: 'local',
          triggerAction: 'all',
          selectOnFocus:true,
          name:'user_type',
          emptyText:'请选择用户类型...',
          allowBlank: false,
          anchor: '90%'
        });

        var loginForm = new Ext.FormPanel({
          labelWidth: 65, // label settings here cascade unless overridden
          url:'/index/validate_user',
          frame:true,
          method: 'GET',
          applyTo:'login_td',
          buttonAlign:'center',
          title:'系统登录',
          height: 155,
          //bodyStyle:'padding:5px 5px 0',
          //width: 300,
          //defaults: {width: 180},
          defaultType: 'textfield',
          items: [{
              fieldLabel: '账号',
              name: 'login_id',
              allowBlank:false,
              anchor: '90%'
            },{
              fieldLabel: '密码',
              inputType: 'password',
              name: 'password',
              allowBlank:false,
              anchor: '90%'
            },userType
          ],
          buttons:[loginButton,registerButton]
        });


        //正在竞价信息
        var purchaseDS = new Ext.data.Store({
          paramNames: {
            start: "start",
            limit: "limit"
          },
          baseParams: {
            start: 0,
            limit: 15
          },
          proxy: new Ext.data.HttpProxy({
            url: '/purchase/getPurchasesForIndex'
          }),
          reader: new Ext.data.JsonReader({
            totalProperty: 'totalProperty',
            root: 'root'
          }, [{
              name: 'id'
            },{
              name: 'manager'
            }, {
              name: 'product_name'
            }, {
              name: 'model'
            }, {
              name: 'specification'
            }, {
              name: 'manufacturer'
            }, {
              name: 'begin_date'
            }, {
              name: 'end_date'
            }, {
              name: 'auditing_status'
            }, {
              name: 'release_status'
            }, {
              name: 'brand'
            },{
              name: 'supply_date'
            }])
        });
        var purchaseCM = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(),{
            header: '产品名称',
            dataIndex: 'product_name',
            width:180
          }, {
            header: '品牌',
            dataIndex: 'brand',
            width:60
          }, {
            header: '型号',
            dataIndex: 'model',
            width:100
          }, {
            header: '规格',
            dataIndex: 'specification',
            width:80
          }, {
            header: '生产商',
            dataIndex: 'manufacturer',
            width:80
          }, {
            header: '供货日期',
            dataIndex: 'supply_date',
            renderer: Ext.util.Format.dateRenderer('Y-m-d'),
            width:75
          }/*, {
            header: '竞开日期',
            dataIndex: 'begin_date',
            renderer: Ext.util.Format.dateRenderer('Y-m-d'),
            width:75
          }, {
            header: '竞束日期',
            dataIndex: 'end_date',
            renderer: Ext.util.Format.dateRenderer('Y-m-d'),
            width:75
          }*/, {
            header: '查看详情',
            dataIndex: 'manufacturer',
            renderer: actionRender,
            width:70
          }]);

        function actionRender(value, cellmeta, record, rowIndex, columnIndex, store){
          return "<a style=cursor:pointer;color:blue onclick=\"Ext.MessageBox.alert('消息', '请登录后查看详情！')\">查看</a>";
        }

        var purchaseGrid =  new Ext.grid.GridPanel({
          ds: purchaseDS,
          cm: purchaseCM,
          sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
          applyTo:'purchase_list',
          width: 680,
          height: 400,
          iconCls: 'icon-grid',loadMask: true,
          loadMask: true,
          bbar: new Ext.PagingToolbar({
            pageSize: pageSize,
            store: purchaseDS,
            displayInfo: true,
            displayMsg: "显示第 {0} 条到 {1} 条记录，一共 {2} 条",
            emptyMsg: "没有记录"
          })
        });
        purchaseDS.load();
      }
    )
    </script>
  </head>
  <body bgcolor="#FFFFFF">
    <!-- Save for Web Slices (青岛海洋大学3.psd) -->
    <table width="1001" height="822" border="0" align="center" cellpadding="0" cellspacing="0" id="__01">
      <tr>
        <td rowspan="3">
          <img src="/images/index/index_01.gif" width="1" height="73" alt=""/></td>
        <td colspan="9" rowspan="2">
          <img src="/images/index/index_02.gif" width="692" height="71" alt=""/></td>
        <td colspan="3">
<%#*<a href="#" onclick="shouye()"><img src="/images/index/index_03.gif" width="103" height="33" alt=""/></a></td>%>

          <a onclick="SetHome(this,window.location)"><img src="/images/index/index_03.gif" width="103" height="33" alt=""/></a></td>
        <td colspan="2">
<%#*<a href="#" onclick="shoucang()"><img src="/images/index/index_04.gif" width="83" height="33" alt=""/></a></td>%>
          <a onclick="AddFavorite(window.location,document.title)"><img src="/images/index/index_04.gif" width="83" height="33" alt=""/></a></td>
        <td colspan="2">
          <a href="/article/show?id=1" target="_blank"><img src="/images/index/index_05.gif" width="100" height="33" alt=""/></a></td>
        <td rowspan="3">
          <img src="/images/index/index_06.gif" width="21" height="73" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="33" alt=""/></td>
      </tr>
      <tr>
        <td colspan="7" rowspan="2">
          <img src="/images/index/index_07.gif" width="286" height="40" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="38" alt=""/></td>
      </tr>
      <tr>
        <td colspan="9">
          <img src="/images/index/index_08.gif" width="692" height="2" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="2" alt=""/></td>
      </tr>
      <tr>
        <td colspan="18">
          <img src="/images/index/index_09.gif" width="1000" height="147" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="147" alt=""/></td>
      </tr>
      <tr>
        <td colspan="18">
          <img src="/images/index/index_10.gif" width="1000" height="1" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="1" alt=""/></td>
      </tr>
      <tr>
        <td colspan="5" rowspan="5" bgcolor="#FFFFFF" valign="top"><br/><div id="login_td" valign="top"></div></td>
        <td rowspan="6">
          <img src="/images/index/index_12.gif" width="1" height="190" alt=""/></td>
        <td rowspan="11">
          <img src="/images/index/index_13.gif" width="7" height="517" alt=""/></td>
        <td colspan="2" rowspan="3">
          <img src="/images/index/index_14.gif" width="385" height="51" alt=""/></td>
        <td colspan="9">
          <img src="/images/index/index_15.gif" width="349" height="13" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="13" alt=""/></td>
      </tr>
      <tr>
        <td colspan="2">
          <a href="/article/brife" target="_blank"><img src="/images/index/index_16.gif" width="90" height="34" border="0" alt=""/></a></td>
        <td rowspan="3">
          <img src="/images/index/index_17.gif" width="25" height="80" alt=""/></td>
        <td colspan="2">
          <a href="/opab_user_guide.pdf" target="_blank"><img src="/images/index/index_18.gif" width="92" height="34" border="0" alt=""/></a></td>
        <td rowspan="3">
          <img src="/images/index/index_19.gif" width="21" height="80" alt=""/></td>
        <td colspan="2">
          <a href="/article/show?id=4" target="_blank"><img src="/images/index/index_20.gif" width="100" height="34" border="0" alt=""/></a></td>
        <td rowspan="10">
          <img src="/images/index/index_21.gif" width="21" height="504" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="34" alt=""/></td>
      </tr>
      <tr>
        <td colspan="2">
          <img src="/images/index/index_22.gif" width="90" height="4" alt=""/></td>
        <td colspan="2" rowspan="2">
          <img src="/images/index/index_23.gif" width="92" height="46" alt=""/></td>
        <td colspan="2" rowspan="2">
          <img src="/images/index/index_24.gif" width="100" height="46" alt="" /></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="4" alt=""/></td>
      </tr>
      <tr>
        <td rowspan="8" bgcolor="#FFFFFF">&nbsp;</td>
        <td colspan="2">
          <img src="/images/index/index_26.gif" width="408" height="42" alt=""/></td>
        <td>
          <img src="/images/index/index_27.gif" width="48" height="42" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="42" alt=""/></td>
      </tr>
      <tr>
        <td colspan="8" rowspan="6" bgcolor="#FFFFFF"><div id="purchase_list"></div></td>
        <td rowspan="7">
          <img src="/images/index/index_29.gif" width="9" height="424" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="95" alt=""/></td>
      </tr>
      <tr>
        <td colspan="5">
          <img src="/images/index/index_30.gif" width="258" height="2" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="2" alt=""/></td>
      </tr>
      <tr>
        <td colspan="6">
          <img src="/images/index/index_31.gif" width="259" height="39" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="39" alt=""/></td>
      </tr>
      <tr>
        <td colspan="6">
          <img src="/images/index/index_32.gif" width="259" height="5" alt=""/></td>
        <td>
          <img src="/images/index/1.gif" width="1" height="5" alt=""/></td>
      </tr>
      <tr>
        <td colspan="2">
          <img src="/images/index/index_33.gif" width="8" height="245" alt=""/></td>
        <td colspan="2" bgcolor="#F7F7F7">
      <marquee align="left" direction="up" height="230" scrolldelay=50 scrollamount=2  onmouseover=this.stop() onmouseout=this.start()>
        <%=@article_standard.content%>
      </marquee>
    </td>
    <td colspan="2" rowspan="3">
      <img src="/images/index/index_35.gif" width="8" height="283" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="1" height="245" alt=""/></td>
  </tr>
  <tr>
    <td colspan="4" rowspan="2">
      <img src="/images/index/index_36.gif" width="251" height="38" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="1" height="26" alt=""/></td>
  </tr>
  <tr>
    <td colspan="8">
      <img src="/images/index/index_37.gif" width="685" height="12" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="1" height="12" alt=""/></td>
  </tr>
  <tr>
    <td>
      <img src="/images/index/index_38.gif" width="1" height="83" alt=""/></td>
    <td colspan="2">
      <img src="/images/index/index_39.gif" width="17" height="83" alt=""/></td>
    <td colspan="15" valign="top" background="/images/index/index_39.gif"><table width="967" height="74" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="967" height="25" align="center"><span class="f12">  　<a href="/article/show?id=5" target="_blank">联系我们</a>　 | 　
              <a href="/article/brife" target="_blank">系统简介</a>　 |　 <a href="/opab_user_guide.pdf" target="_blank">系统说明</a> 　| 　
              <a href="/article/show?id=4" target="_blank">规章制度</a></span></td>
        </tr>
        <tr>
          <td height="49" align="center"><span class="qq"><span class="b12">版权声明：本站版权所有，盗版必究  【建议采用IE6.0及以上版本，分辨率在1024*768及以上】</span></span></td>
        </tr>
      </table></td>
    <td>
      <img src="/images/index/1.gif" width="1" height="83" alt=""/></td>
  </tr>
  <tr>
    <td>
      <img src="/images/index/1.gif" width="1" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="7" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="10" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="233" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="7" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="1" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="7" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="19" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="366" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="42" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="48" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="25" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="30" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="62" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="21" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="91" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="9" height="1" alt=""/></td>
    <td>
      <img src="/images/index/1.gif" width="21" height="1" alt=""/></td>
    <td></td>
  </tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html>